<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/9
 * Time: 18:26
 */

class Circle
{
    private $r;
private $d='abc';
    public function __construct($r)
    {
        $this -> r = $r;

    }

    public function _clone(){
        $this->r=10;
    }

    public function getArea(){
        return r*r*3.14;
    }

    public function __toString()
    {
        // TODO: Implement __toString() method.
        return '半径为'.$this->r;
    }

    public function __call($name, $arguments)
    {
        die("你调用的方法不存在".$name);
    }


    public  function  __sleep(){
        return array("r");
    }

    public  function  __wakeup(){

    }

}

$c = new Circle(3);

$str = serialize($c);
echo $str;

$d = unserialize($str);
echo "<br/>";
var_dump($d);
?>

